<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
	.error {
	  color: red;
	 }
</style>
</head>
<body>
 
<c:if test="${categoryExists}">
	<td><c:out value="Category alreadry exits!"/></td>
</c:if>

<form:form modelAttribute="category" method="POST" action="">
 <table>
 
  <tr>
   <td><form:label path="name">name:</form:label></td>
   <td><form:input path="name"/></td>
   <td><form:errors path="name" cssClass="error"/></td>
  </tr>

 </table>
 <table>
 <tr>
<c:if test="${!add}">
	<td><input type="submit"  name="action"  value="Save" /></td>
</c:if>
 <c:if test="${add}">
 	<td><input type="submit"  name="action"  value="Add" /></td>
</c:if>
<td><a href="<c:url value="/admin/category"/>" >back</a></td>
</tr>
</table>
</form:form>
</body>
</html>